Skip to content

feat: per-turn ledger — time, tokens, cost per user turn - #37

Merged
alloevil merged 1 commit into
masterfrom
feat/turn-ledger
Sep 7, 2026
Merged

feat: per-turn ledger — time, tokens, cost per user turn#37
alloevil merged 1 commit into
masterfrom
feat/turn-ledger

Conversation

@alloevil

@alloevil alloevil commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Session summary gains a table with one row per user turn: wall-clock from
the user message to the last agent message of the turn, tool calls and
errors, input/output/cache tokens and cost summed from assistant usage,
with bars scaled to the session maximum so the expensive turn is visible
before reading any number. Rows jump to the originating user message.

buildTurnLedger lives in lib/pure.ts (also bundled into public/js/pure.js);
unit tests cover attribution, content-part tool calls, both cost shapes,
total_tokens-only platforms, and the no-usage case.

Session summary gains a table with one row per user turn: wall-clock from
the user message to the last agent message of the turn, tool calls and
errors, input/output/cache tokens and cost summed from assistant usage,
with bars scaled to the session maximum so the expensive turn is visible
before reading any number. Rows jump to the originating user message.

buildTurnLedger lives in lib/pure.ts (also bundled into public/js/pure.js);
unit tests cover attribution, content-part tool calls, both cost shapes,
total_tokens-only platforms, and the no-usage case.
@alloevil
alloevil merged commit 41399e5 into master Sep 7, 2026
3 checks passed
@alloevil
alloevil deleted the feat/turn-ledger branch September 7, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant